package dto

import "ginEssential/model"

type CharacterDto struct {
	Name string `json:"name"`
	Id   int    `json:"id"`
	Age  int    `json:"age"`
}

func ToCharacterDto(characters []model.Character) []CharacterDto {
	var res []CharacterDto
	for _, c := range characters {
		res = append(res, CharacterDto{
			Name: c.Name,
			Id:   c.Id,
			Age:  c.Age,
		})
	}
	return res
}
